﻿<Window x:Class="centraldba_dbrestore_utility.Configure_ServerList"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:data="clr-namespace:centraldba_dbrestore_utility.Data"
        xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" 
        Title="Configure Server List" 
        Height="400" 
        Width="400" 
        ResizeMode="NoResize" 
        ShowInTaskbar="False" 
        WindowStartupLocation="CenterOwner" 
        WindowStyle="ToolWindow" 
        Loaded="Window_Loaded"
        FocusManager.FocusedElement="{Binding ElementName=lstDatabaseServers}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBox Grid.Row="0" 
                 IsReadOnly="True" 
                 TextWrapping="Wrap" 
                 IsTabStop="False"
                 Text="Use the following list to choose which database servers are visible in this utility." />

        <ListBox Name="lstDatabaseServers" 
                 Grid.Row="1"
                 SelectionMode="Multiple"
                 DisplayMemberPath="env_server_name" 
                 SelectionChanged="lstDatabaseServers_SelectionChanged">
            <ListBox.ItemContainerStyle>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="IsSelected" Value="{Binding is_visible, Mode=OneTime}" />
                </Style>
            </ListBox.ItemContainerStyle>
        </ListBox>

        <Button Grid.Row="2" Content="Submit" Click="cmdSubmit_Click" />
    </Grid>
</Window>
